﻿/* v0.0.1 2016-09-19 by howard */
;(function(win) {
	var _selfUserAgent = navigator.userAgent;
	var _selfAppVersion = navigator.appVersion;
	var isAndroid = _selfUserAgent.indexOf('Android') > -1 || _selfUserAgent.indexOf('Linux') > -1; //android终端或者uc浏览器
	var isiOS = !!_selfUserAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
	console.log('是否是Android：'+isAndroid);
	console.log('是否是iOS：'+isiOS);
	/**
	*如果在head中引入该JS的话body标签还没有构造出所有后面的代码会报错
	*/
	var h = "";
	h += " window.innerHeight: "+window.innerHeight+"\n";
	h += " 网页可见区域宽："+ document.body.clientWidth+"\n";
	h += " 网页可见区域高："+ document.body.clientHeight+"\n";
	h += " 网页可见区域宽："+ document.body.offsetWidth +" (包括边线和滚动条的宽)"+"\n";
	h += " 网页可见区域高："+ document.body.offsetHeight +" (包括边线的宽)"+"\n";
	h += " 网页正文全文宽："+ document.body.scrollWidth+"\n";
	h += " 网页正文全文高："+ document.body.scrollHeight+"\n";
	h += " 网页被卷去的上："+ document.body.scrollTop+"\n";
	h += " 网页被卷去的左："+ document.body.scrollLeft+"\n";
	h += " 网页正文部分上："+ window.screenTop+"\n";
	h += " 网页正文部分左："+ window.screenLeft+"\n";
	h += " 屏幕分辨率的宽："+ window.screen.width+"\n";
	h += " 屏幕分辨率的高："+ window.screen.height+"\n";
	h += " 屏幕可用工作区宽度："+ window.screen.availWidth+"\n";
	h += " 屏幕可用工作区高度："+ window.screen.availHeight+"\n";
	h += " 你的屏幕设置是 "+ window.screen.colorDepth +" 位彩色"+"\n";
	h += " 你的屏幕设置 "+ window.screen.deviceXDPI +" 像素/英寸"+"\n";
	h += "你的设备像素比DPR是"+window.devicePixelRatio+"\n";
	console.log(h);
	//alert(h);
})();